package com.muyu.system.domain;

import com.baomidou.mybatisplus.annotation.TableField;
import com.muyu.common.core.annotation.Excel;
import com.muyu.common.core.web.domain.BaseEntity;
import com.muyu.system.enums.OperatingTypeEnum;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;

import java.math.BigDecimal;

/**
 * 商品对象 dm_shopping_goods
 *
 * @author ruoyi
 * @date 2025-01-20
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
public class DmShoppingGoods extends BaseEntity
{
    private static final long serialVersionUID = 1L;

    /** id */
    private Long id;

    /** 商品名 */
    @Excel(name = "商品名")
    private String goodsName;

    /** 商品状态（0：下架，1：上架） */
    @Excel(name = "商品状态", readConverterExp = "0=：下架，1：上架")
    private Long states;

    /** 商品标题（不超过50字） */
    @Excel(name = "商品标题", readConverterExp = "不=超过50字")
    private String goodsTitle;

    /** 商品主图 */
    @Excel(name = "商品主图")
    private String goodsPic;

    /** 商品轮播图（最多4张）","分割 */
    @Excel(name = "商品轮播图", readConverterExp = "最=多4张")
    private String goodsCarouselPic;

    /** 商品分类id */
    @Excel(name = "商品分类id")
    private Long goodsTypeId;

    /** 商品分类名称 */
    @Excel(name = "商品分类名称")
    private String goodsTypeName;

    /** 商品二级分类id */
    @Excel(name = "商品二级分类id")
    private Long goodsSubtypeId;

    /** 商品二级分类名称 */
    @Excel(name = "商品二级分类名称")
    private String goodsSubtypeName;

    /** 商品详情描述 */
    @Excel(name = "商品详情描述")
    private String goodsDetail;

    /** 商品详情图片 */
    @Excel(name = "商品详情图片")
    private String goodsDetailPic;

    /** 商品价格 */
    @Excel(name = "商品价格")
    private BigDecimal goodsPrice;

    /** 商家id */
    @Excel(name = "商家id")
    private Long storeId;

    /** 商家名称 */
    @Excel(name = "商家名称")
    private String storeName;

    /** 删除标志（0代表存在 2代表删除） */
    private String delFlag;
    @TableField(exist = false)
    private Integer pageNum = 1;
    @TableField(exist = false)
    private Integer pageSize = 10;


    /**
     * 是否收藏
     * @return
     */
    private String whetherToCollect;


    /**
     *
     * 收藏人数
     * @return
     */
    private Integer collectionNumber;


    /**
     * 发货地省
     */
    private String originShipmentProvince;

    /**
     * 发货地市
     */
    private String originShipmentCity;


    /**
     * 精选服务逗号分割， 1七天无理由  2 24小时发货 3 48小时发货  4 假一赔十 5 退货包运费  6 急速退款
     */
    private String featureService;


    /**
     * 商品类型  （1：三方，2：自营，3：混合）
     */
    private OperatingTypeEnum type;
    /**
     * 三方链接
     */
    private String url;
    /**
     * 跳转包名
     */
    private String packageName;



    /**
     * 排序字段   desc 降  asc 升
     */
    @TableField(exist = false)
    private String orderByColumn;
    @Override
    public String toString() {
        return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
                .append("id", getId())
                .append("goodsName", getGoodsName())
                .append("states", getStates())
                .append("goodsTitle", getGoodsTitle())
                .append("goodsPic", getGoodsPic())
                .append("goodsCarouselPic", getGoodsCarouselPic())
                .append("goodsTypeId", getGoodsTypeId())
                .append("goodsTypeName", getGoodsTypeName())
                .append("goodsSubtypeId", getGoodsSubtypeId())
                .append("goodsSubtypeName", getGoodsSubtypeName())
                .append("goodsDetail", getGoodsDetail())
                .append("goodsDetailPic", getGoodsDetailPic())
                .append("goodsPrice", getGoodsPrice())
                .append("storeId", getStoreId())
                .append("storeName", getStoreName())
                .append("delFlag", getDelFlag())
                .append("createBy", getCreateBy())
                .append("createTime", getCreateTime())
                .append("updateBy", getUpdateBy())
                .append("updateTime", getUpdateTime())
                .append("remark", getRemark())
                .toString();
    }
}
